#ifndef __HTTP_PROT_WRITE_H_
#define __HTTP_PROT_WRITE_H_

#include <vector>
#include <string>


namespace httpprot
{
	inline
	void WriteChar( char c, std::vector< char >& bufferOut )
	{
		bufferOut.push_back( c );
	}

	inline
	void WriteCString( const char * cString, std::vector< char >& bufferOut )
	{
		unsigned int length = strlen( cString );
		bufferOut.insert( bufferOut.end( ), cString, cString + length );
	}

	inline
	void WriteString( const std::string& s, std::vector< char >& bufferOut )
	{
		unsigned int length = s.length( );
		if( length )
		{
			const char * cString = s.c_str( );
			bufferOut.insert( bufferOut.end( ), cString, cString + length );
		}
	}

	inline
	void WriteVector( const std::vector< char >& v, std::vector< char >& bufferOut )
	{
		bufferOut.insert( bufferOut.end( ), v.begin( ), v.end( ) );
	}
};

#endif